{extend name='public/modal'}
{block name='content'}
<style type="text/css">
    .submit_btn{
         float: center;
  }
</style>
<form action="add_user_new" class="layui-form layui-form-pane" id="mainForm" method="post">

    <form class="form-horizontal" id='addForm' action="addUser">

        <div class="layui-form-item">
            <label class="layui-form-label">
                名称
            </label>
            <div class="layui-input-block">
                    <input type="username" name="username"  class="layui-input" id="username" placeholder="名称">
            </div>
        </div>


        <div class="layui-form-item">
            <label class="layui-form-label">
                密码
            </label>
            <div class="layui-input-block">
                    <input type="password" name="password" class="layui-input" id="password" placeholder="请输入密码">
            </div>
        </div>


            <div class="layui-form-item">
            <label class="layui-form-label">
                确认
            </label>
            <div class="layui-input-block">
                    <input type="password" name="check_password" class="layui-input" id="check_password" placeholder="确认密码">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">
                手机号码
            </label>
            <div class="layui-input-block">
                    <input type="text" name="mobile" class="layui-input" id="mobile" placeholder="请输入手机号码">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">
                邮箱
            </label>
            <div class="layui-input-block">
                    <input type="email" name="email" class="layui-input" id="email" placeholder="请输入电子邮箱">
            </div>
        </div>



    <div class="layui-form-item">
        <div class="layui-input-block submit_btn">
            <input id="addReset" type="reset" style="display: none" value="这个是Form清除" />
            <button type="submit" class="layui-btn layui-btn-success">保存</button>
        </div>
    </div>
</form>
{/block}
{block name='js'}

<script type="text/javascript" src="__common__/js/piccheckbox.js"></script>

<script type="text/javascript">

    //单图添加
    function addfile() {
      var b = $('#single_parentIframe').val();
      if(b){
        b= b.split(','); 
        console.log(b.length);
        layer.msg('请先删除再添加，只能选单张喔！');
      }else{
        lotus_show('图片管理器','{:url('admin/Picmanagement/showAddfilelist')}',0,0);
        $("#dshow").val('1');
      }
    }

    //多图添加
    function addfiles(){
      $("#dshow").val('');
      lotus_show('图片管理器','{:url('admin/Picmanagement/showAddfilelist')}',0,0)
    }

  </script>

  
<script type="text/javascript">
    $(function(){
        var options = {
              type:'post',           //post提交
              //url:'http://ask.tongzhuo100.com/server/****.php?='+Math.random(),   //url
              dataType:"json",        //json格式
              data:{},    //如果需要提交附加参数，视情况添加
              clearForm: false,        //成功提交后，清除所有表单元素的值
              resetForm: false,        //成功提交后，重置所有表单元素的值
              cache:false,
              async:false,          //同步返回
              success:function(data){
                    if(data.code==0){
                      layer.msg(data.msg);
                    }else{
                      layer.msg(data.msg,{icon:1,time:500},function(){
                        $("#reset").click();
                        lotus_close();
                        parent.location.reload();
                      });
                    }
                  //服务器端返回处理逻辑
                },
                error:function(XmlHttpRequest,textStatus,errorThrown){
                  layer.msg('操作失败:服务器处理失败');
              }
            };
          layui.use('form', function(){
            var form = layui.form;
            $('#mainForm').ajaxForm(options).submit(function(data){});
          });

        })
      // });
</script>
{/block}
